<template>
  <div class="pagination">
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page"
      layout="total, sizes, prev, pager, next, jumper"
      :page-sizes="pageSizes"
      :page-size="pageSize"
      :page-count="pages"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: 'Pagination',
  props: ['page', 'pages', 'pageSize', 'pageSizes'],
  data() {
    return {
      ruleForrm: {
        user: ''
      }
    }
  },
  methods: {
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`)
      // this.pageSize = val
      // this.page = 1
      this.$emit('changeSize', val)
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`)
      // this.page = val
      this.$emit('changePage', val)
    }
  }
}
</script>

<style lang="scss" scoped>
.pagination {
  display: flex;
  justify-content: right;
}
</style>
